<template>
  <div>
    <topNav text="我的收藏" @sendBack="sendBack"></topNav>
    <Postltem :postData="item" v-for="item in  postList" :key="item.id"></Postltem>
  </div>
</template>

<script>
import topNav from "@/components/topNav.vue";
import Postltem from "@/components/Postltem.vue";
import { log } from "util";
export default {
  components: { topNav, Postltem },
  data() {
    return {
      postList: []
    };
  },
  created() {
    this.$axios({
      url: "/user_star",
      method: "get",
      headers: {
        Authorization: "Bearer " + localStorage.getItem("token")
      }
    }).then(res => {
      console.log(res.data);
      this.postList = res.data.data;
    });
  },
  methods: {
    sendBack() {
      this.$router.replace({ path: "/personal" });
    }
  }
};
</script>

<style>
</style>